﻿using My.Core.Model;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace My.Core.Model.Models
{
    /// <summary>
    /// 按钮跟权限关联表
    /// </summary>
    public class FrameworkRoleMenuPermission 
    {
        /// <summary>
        /// 按钮跟权限关联表 默认构造
        /// </summary>
        public FrameworkRoleMenuPermission()
        {
            //this.Role = new Role();
            //this.Module = new Module();
            //this.Permission = new Permission();

        }

        /// <summary>
        /// 主键Id
        /// </summary>
        [DisplayName("主键Id")]
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        ///获取或设置是否禁用，逻辑上的删除，非物理删除
        /// </summary>
        [Display(Name = "是否删除")]
        [DefaultValue(false)]
        public bool? IsDeleted { get; set; }


        /// <summary>
        /// 角色ID
        /// </summary>
        [Display(Name = "角色ID")]
        public int? RoleId { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Display(Name = "角色")]
        public FrameworkRole Role { get; set; }

        /// <summary>
        /// 按钮ID 或菜单
        /// </summary>
        [Display(Name = "按钮ID")]
        public int? MenuItemId { get; set; }
        /// <summary>
        /// 按钮ID 或菜单
        /// </summary>
        [Display(Name = "按钮ID")]
        public FrameworkMenu MenuItem { get; set; }

        /// <summary>
        /// 创建ID
        /// </summary>
        [Display(Name = "创建ID")]
        public int? CreateId { get; set; }
        /// <summary>
        /// 创建者
        /// </summary>
        [Display(Name = "创建者")]
        [StringLength(50)]
        public string CreateBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 修改ID
        /// </summary>
        [Display(Name = "修改ID")]
        public int? ModifyId { get; set; }
        /// <summary>
        /// 修改者
        /// </summary>
        [Display(Name = "修改者")]
        public string ModifyBy { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [Display(Name = "修改时间")]
        public DateTime? ModifyTime { get; set; } = DateTime.Now;

        
    }
}
